﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NIP.ControllerInterface
{
    interface IUsbc
    {
        #region Events
        /// <summary>
        /// Occurs when the USBC Controller finished initializing.
        /// </summary>
        event EventHandler<InitializationCompletedEventArgs> InitializationCompleted;

        /// <summary>
        /// Occurs when the homing status changes.
        /// </summary>
        event EventHandler<HomingStatusEventArgs> HomingStatusChanged;

        /// <summary>
        /// Occurs when the USBC Controller recieves digital input.
        /// </summary>
        event EventHandler<IOEventArgs> DigitalInputReceived;

        /// <summary>
        /// Occurs when the USBC Controller recieves digital output.
        /// </summary>
        event EventHandler<IOEventArgs> DigitalOutputReceived;

        /// <summary>
        /// Occurs when the joint status changes.
        /// </summary>
        event EventHandler<JointStatusEventArgs> JointStatusChanged;

        /// <summary>
        /// Occurs when the control status changes.
        /// </summary>
        event EventHandler<ControlStatusEventArgs> ControlStatusChanged;

        /// <summary>
        /// Occurs when a motion is started.
        /// </summary>
        event EventHandler<MotionEventArgs> MotionStarted;

        /// <summary>
        /// Occurs when a motion have ended.
        /// </summary>
        event EventHandler<MotionEventArgs> MotionEnded;

        /// <summary>
        /// Occurs when a unspecified action have started.
        /// </summary>
        event EventHandler ActionStarted;

        /// <summary>
        /// Occurs when a unspecified action have completed.
        /// </summary>
        event EventHandler ActionCompleted;

        #endregion

        //Setup
        bool Initialization(short sMode, short sSystemType);
        bool Control(byte ucGroupAxis, bool bIsOn);
        bool Home(byte ucGroupAxis);

        //Movement
        bool Stop(byte ucGroup);
        bool OpenGripper();
        bool CloseGripper();
        bool GetJaw(ref short percent, ref short mm);
        bool DefineVector(byte ucGroup, string szVectorName, short sDimension);
        bool Here(string szVectorName, short sPointNumber, long lPointType);
        bool Teach(string szVectorName, short sPointNumber, int[] plCoolArray, short sCoorArrayDim, long lPointType);
        bool MoveLinear(string szVectorName, short sPointNumber, string szVectorNameB, short sPointNumberB);
        bool IsOnlineOk();
        bool GetCurrentPosition(int[] pEnc, int[] pJoint, int[] pXYZ);
        bool EnterManual(short sManualType);
        bool CloseManual();
        bool MoveManual(byte ucAxis, long lVelocity);
        bool Time(byte ucGroup, long lTime);
        bool Speed(byte ucGroup, long lSpeed);



    }
}
